function listChange(){
	if( document.getElementsByName("sameWithList")[0].checked ){
		document.getElementsByName("ftpDownloadUserName")[0].value=document.getElementsByName("ftpUserName")[0].value;
		document.getElementsByName("ftpDownloadUserPass")[0].value=document.getElementsByName("ftpUserPass")[0].value;
	}
}

function accountChange(same){
	if(!same.checked){
		document.getElementsByName("ftpDownloadUserName")[0].disabled=false;
		document.getElementsByName("ftpDownloadUserName")[0].value=document.getElementsByName("ftpUserName")[0].value;
		document.getElementsByName("ftpDownloadUserPass")[0].disabled=false;
		document.getElementsByName("ftpDownloadUserPass")[0].value=document.getElementsByName("ftpUserPass")[0].value;
	}else{
		document.getElementsByName("ftpDownloadUserName")[0].disabled=true;
		document.getElementsByName("ftpDownloadUserPass")[0].disabled=true;
	}
}

function selectChange(selector, name, size){
	var value = selector.value;
	var i;
	if (value != "child"){
		for( i=1 ; i <= size ; i++ ){
			sub = document.getElementById(name+i);
			sub.value="unsearch";
			sub.disabled=true;
		}
	}else{
		for( i=1 ; i <= size ; i++ ){
			sub = document.getElementById(name+i);
			sub.value="other";
			sub.disabled=false;
		}
	}
}

function rootSelectChange(selector, size){
	var value = selector.value;
	var i;
	var rootSub;
	if (value != "child"){
		for( i=1 ; i <= size ; i++ ){
			rootSub = document.getElementById(selector.name+i);
			rootSub.value="unsearch";
			rootSub.disabled=true;
			
			onchangeFunction=rootSub.getAttribute("onchange");
			onchangeFunction.call();
		}
	}else{
		for( i=1 ; i <= size ; i++ ){
			rootSub = document.getElementById(selector.name+i);
			rootSub.value="child";
			rootSub.disabled=false;
			
			onchangeFunction=rootSub.getAttribute("onchange");
			onchangeFunction.call();
		}
	}
	
}
